package validadores_mixins;

import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;

import exception.ValorInvalidoException;

public class ValidarStringNoVacioM implements PropertyChangeListener {

	public Boolean validar(String valor) {
		return (valor.trim().length()) > 0;

	}

	@Override
	public void propertyChange(PropertyChangeEvent arg0) {
		String nombre = arg0.getNewValue().toString();
		if (!this.validar(nombre)) {
			throw new ValorInvalidoException("error, ingrese nombre");
		}

	}
}